import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询工序管理列表
 * @param query
 * @returns {*}
 */

export const listProcess = (query?: ProcessVO): AxiosPromise<ProcessVO[]> => {
  return request({
    url: '/wms/process/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询工序管理详细
 * @param id
 */
export const getProcess = (id: number): AxiosPromise<ProcessVO> => {
  return request({
    url: '/wms/process/' + id,
    method: 'get'
  });
};

/**
 * 新增工序管理
 * @param data
 */
export const addProcess = (data: ProcessVO) => {
  return request({
    url: '/wms/process',
    method: 'post',
    data: data
  });
};

/**
 * 修改工序管理
 * @param data
 */
export const updateProcess = (data: ProcessVO) => {
  return request({
    url: '/wms/process',
    method: 'put',
    data: data
  });
};

/**
 * 删除工序管理
 * @param id
 */
export const delProcess = (id: string | number | (string | number | undefined)[]) => {
  return request({
    url: '/wms/process/' + id,
    method: 'delete'
  });
};

export interface ProcessVO extends BaseEntity, PageQuery {
    /** 主键 */
      id?: string | number;

    /** 工序名称 */
      name?: string;

    /** 工艺类别 */
      treeValue?: string;

    /** 工艺要求 */
      attention?: string;

    /** 状态 */
      status?: string;

    /** 备注 */
      remark?: string;

}
